import requests

# 百度云AI文字识别提供的代码
# client_id 为官网获取的AK， client_secret 为官网获取的SK
AK = "******"
SK = "******"
host = f'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id={AK}&client_secret' \
       f'={SK}'
response = requests.get(host)
if response:
    print(response.json())
